package com.tcm.user.constants.enums;

/**
 * @author
 * 社交登录类型
 */
public enum SignupTypeEnum {
	/**
	 * 账号密码注册
	 */
	PWD("PWD", "账号密码注册"),

	/**
	 * 手机密码注册
	 */
	PHONE_PWD("PHONE_PWD", "手机号+密码注册"),

	/**
	 * 免密注册
	 */
	SMS("SMS_SIGNUP", "手机号+验证码免密登录")
	;


	/**
	 * 类型
	 */
	private final String type;
	/**
	 * 描述
	 */
	private final String description;

    SignupTypeEnum(String type, String description) {
        this.type = type;
        this.description = description;
    }

    public String type() {
        return this.type;
    }

    public String description() {
        return this.description;
    }

	public static String getValue(String value) {
		SignupTypeEnum[] businessModeEnums = values();
		for (SignupTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.type();
			}
		}
		return null;
	}

	public static String getDesc(String value) {
		SignupTypeEnum[] businessModeEnums = values();
		for (SignupTypeEnum businessModeEnum : businessModeEnums) {
			if (businessModeEnum.type().equals(value)) {
				return businessModeEnum.description();
			}
		}
		return null;
	}

}
